import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";

const routes = [
    {
        path: '/',
        alias: ['/home', '/qwe'], // 定义别名
        component: () => import('@/views/index.vue')
    },
    {
        path: '/content',
        component: () => import('@/views/content.vue')
    },
    {
        path: '/user/:id/name/:name?',
        name: 'member', // 命名路由
        component: () => import('@/views/user.vue')
    },
    {
        path: '/vip',
        component: () => import('@/views/vip.vue'),
        children: [
            {
                path: '',
                component: () => import('@/views/vip/default.vue')
            },
            {
                path: 'info',
                component: () => import('@/views/vip/info.vue')
            },
            {
                path: 'order',
                component: () => import('@/views/vip/order.vue')
            },
        ]
    }
]

const router = createRouter({
    routes,
    history: createWebHistory()
})

export default router